//
//  HomeTitleButton.swift
//  XDweibo
//
//  Created by HanXingda on 15/6/29.
//  Copyright © 2015年 韩兴达. All rights reserved.
//

import UIKit

class HomeTitleButton: UIButton {

    class func button(title: String) -> HomeTitleButton {
        let titleBtn = HomeTitleButton()
        titleBtn.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        titleBtn.setTitle(title + " ", forState: UIControlState.Normal)
        titleBtn.setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        titleBtn.sizeToFit()
        return titleBtn

    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        titleLabel?.frame.origin.x = 0
        imageView?.frame.origin.x = (titleLabel?.bounds.width)!
    }
}
